package com.monitor.dao;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.monitor.entity.ErpInspectionOrder;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author LX
 * @since 2018-09-30
 */
public interface ErpInspectionOrderMapper extends BaseMapper<ErpInspectionOrder> {
	@Select("SELECT SUM(IH.actual_fee) FROM erp_inspection_order IH WHERE IH.inspection_dt>=#{startTime} AND IH.inspection_dt<=#{endTime} AND IH.branch=#{branch}")
	public Double selectByBranch(@Param("startTime")String startTime,@Param("endTime")String endTime,@Param("branch")String branch);
	
	@Select("SELECT * from erp_inspection_order p where p.customer_name =#{name} and  p.inspection_dt >= #{startTime} and p.inspection_dt <= #{endTime}")
	public List<ErpInspectionOrder> selectByCustName(@Param("name")String name,@Param("startTime")String startTime,@Param("endTime")String endTime);
}
